/*
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2006-2007 Intel Corporation. All Rights Reserved.
//
*/
#include "umc_defs.h"
#if defined (UMC_ENABLE_DV_VIDEO_ENCODER)

#ifndef __ENCODE_BIT_STREAM_H
#define __ENCODE_BIT_STREAM_H

namespace UMC
{

enum
{
    STREAM_NOT_FULL     = -1,                         // stream has free bits
    STREAM_FULL         = 0,                          // stream has enough bits exactly
    STREAM_OVER         = 1,                          // stream has enough bits + extra bits
};

struct BLOCK;

#pragma pack(1)
struct ENCODE_BIT_STREAM
{
    Ipp8u *m_lpcDest;                                // (Ipp8u *) pointer to buffer for compressed DV data
    Ipp32s m_bFreeBits;                              // (Ipp32s) free bits in register
    Ipp32s m_bBitsCanTake;                           // (Ipp32s) free bits, available in stream
    Ipp32s m_wExtraBits;                             // (Ipp32s) count of extra bits, available in stream
    Ipp32u m_dwRegister;                             // (Ipp32u) register with read bits
    struct ENCODE_BIT_STREAM *m_lpNext;              // (DECODE_BIT_STREAM) pointer to next bit stream
};
#pragma pack()

// encode current block
Ipp32s EncodeBitStream(ENCODE_BIT_STREAM *lpStream, struct BLOCK *lpBlock);
// add some bits to stream
Ipp32s AddBits(ENCODE_BIT_STREAM *lpStreamDst, ENCODE_BIT_STREAM *lpStreamSrc);


Ipp32s GetEncodedBlockSize(BLOCK *lpBlock, Ipp32u qno);

}//namespace UMC

#endif //__ENCODE_BIT_STREAM_H

#endif //(UMC_ENABLE_DV_VIDEO_ENCODER)
